import axios from '@/libs/api.request'

/**
 * 表格数据
 * @return {[type]}        [description]
 */
export const findList = (params) => {
  return axios.request({
    url: '/api/dev/getMeterList',
    method: 'get',
    params
  })
}

/**
 * 柱状图数据
 * @return {[type]}        [description]
 */
export const barLine = (params) => {
  return axios.request({
    url: '/api/dev/getMeterHist',
    method: 'get',
    params
  })
}

/**
 * 获取矩形图数据
 * @return {[type]}        [description]
 */
export const rectInfo = (params) => {
  return axios.request({
    url: '/api/dev/getDevByGasClass',
    method: 'get',
    params
  })
}

/**
 * 漏斗图数据
 * @return {[type]}        [description]
 */
export const loudou = (params) => {
  return axios.request({
    url: '/api/dev/getDevCountByStatusType',
    method: 'get',
    params
  })
}
/**
 * 饼图数据
 * @return {[type]}        [description]
 */
export const pieInfo = (params) => {
  return axios.request({
    url: '/api/dev/getDevGroupStatus',
    method: 'get',
    params
  })
}

/**
 * 表格数据修改
 * @param  {[type]} params [description]
 * @return {[type]}        [description]
 */
export const getMeterUnitDetail = (id) => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterUnitDetail/' + id,
    method: 'get'
  })
}

/**
 * 表模型
 * @param  {[type]} params [description]
 * @return {[type]}        [description]
 */
export const getMeterModelList = () => {
  return axios.request({
    url: '/api/dev/getMeterModelList',
    method: 'get'
  })
}

/**
 * 删除数据
 * @param  {[type]} data [description]
 * @return {[type]}        [description]
 */
export const fetchDeleteTableData = (data) => {
  return axios.request({
    url: '/api/dev/deleteByMeterId',
    method: 'post',
    data
  })
}
